<template>
	<view class="add-account-box">
		<u-form :model="form">
			<u-form-item label="账号" labelWidth="140rpx">
				<u-input placeholder="请输入手机号或ID"></u-input>
			</u-form-item>
			<u-form-item label="选择角色" labelWidth="140rpx">
				<u-input placeholder="请选择角色" disabled @tap="show = true" v-model="workName"></u-input>
				<u-icon name="arrow-right"></u-icon>
			</u-form-item>
		</u-form>
		<view class="submit-btn">
			<text>完成</text>
		</view>
		<u-picker v-model="show" mode="selector" :range="selectorObj" range-key="cateName" @confirm="confirmWork"></u-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				form:{
					work:""
				},
				workName:"",
				selectorObj: [{
						cateName: '测试1',
						id: 1
					},
					{
						cateName: '测试2',
						id: 2
					}
				]
			}
		},
		methods:{
			confirmWork(e){
				this.workName = this.selectorObj[e[0]].cateName;
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {}

	.add-account-box {
		padding: 20rpx;
		background-color: #fff;
	}
	.submit-btn{
		width: 90%;
		background: linear-gradient(90deg, #2dae9c, #6bc29e);
		border-radius: 50rpx;
		padding: 20rpx 0;
		color: #fff;
		text-align: center;
		margin: 40rpx auto;
	}
</style>
